☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

default

Table of contents

Description:

This key toggles whether CloudCannon should treat an entry in the values array as the default option for your Object or Array input.

Setting this key to true will mark this entry as the default option for your Object or Array input. If multiple entries in the values array are set to true, CloudCannon will use the first entry. If CloudCannon cannot determine the type of an entry within the values array based on the id_key or matching inputs across values[*].value objects, it will fall back to the default entry.

Appears in:
└── [*]
    └── default
Type:
boolean
Default value:
false
Examples:

In this example, we want the entry labelled Employee to be our default option for populating inputs configured with the staff Structure.

Copied to clipboard
_structures:
  staff:
    style: modal
    values:
      - label: Employee
        default: true
        value:
          name: 
          job_description: 
          profile_picture: 
      - label: Manager
        value:
          name: 
          job_description: 
          profile_picture: 
          url:
{
  "_structures": {
    "staff": {
      "style": "modal",
      "values": [
        {
          "label": "Employee",
          "default": true,
          "value": {
            "name": null,
            "job_description": null,
            "profile_picture": null
          }
        },
        {
          "label": "Manager",
          "value": {
            "name": null,
            "job_description": null,
            "profile_picture": null,
            "url": null
          }
        }
      ]
    }
  }
}
Open in a new tab